import QtQuick 1.1
import com.nokia.meego 1.0
import "Logic.js" as Logic

Page {
    id: mainMenu

    tools: ToolBarLayout {
        id: tool_main_page
        visible: true
        ToolIcon {
            //iconId: "toolbar-view-menu"
            iconSource: "images/toolbar/properties.png"
            anchors.right: parent === undefined ? undefined : parent.right
            onClicked: (qnm_MenuMainPage.status == DialogStatus.Closed) ? qnm_MenuMainPage.open() : qnm_MenuMainPage.close()
        }
        opacity: userTheme.opacityToolbar
    }

    Menu {
        id: qnm_MenuMainPage
        visualParent: pageStack
        MenuLayout {
            MenuItem { text: qsTr("About"); onClicked: { Logic.openFile("About.qml") } }
            MenuItem { text: qsTr("Quit"); onClicked: { Qt.quit() } }
        }
    }

    BackgroundPage { }

    Item {
        id: mainPane
        anchors.centerIn: parent
        width: parent.width
        height: parent.height

        MyMainButton {
            id: pbCategory
            width: parent.width/2
            height: parent.height/2
            anchors.top: parent.top
            anchors.left: parent.feft
            textButtonSize: 20
            textButton: qsTr("Categories")
            image: "images/categories.png"
            //image: "images/categories-gray.png"
            onButtonClick: {
                Logic.openFile("CategoryList.qml")
            }
        }

        MyMainButton {
            id: pbWords
            width: parent.width/2
            height: parent.height/2
            anchors.top: parent.top
            anchors.left: pbCategory.right
            textButtonSize: 20
            image: "images/words.png"
            textButton: qsTr("Words")
            onButtonClick: {
                Logic.openFile("WordsList.qml")
            }
        }

        MyMainButton {
            id: pbLearning
            width: parent.width/2
            height: parent.height/2
            anchors.top: pbWords.bottom
            anchors.left: pbSettings.right
            textButtonSize: 20
            textButton: qsTr("Learn words")
            image: "images/learn.png"
            onButtonClick: {
                Logic.openFile("LearnStart.qml")
            }
        }

        MyMainButton {
            id: pbSettings
            width: parent.width/2
            height: parent.height/2
            anchors.top: pbCategory.bottom
            anchors.left: parent.feft
            textButtonSize: 20
            //textButton: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? qsTr("Settings & statistics") : qsTr("Settings &\nstatistics")
            textButton: qsTr("Settings")
            image: "images/settings.png"
            onButtonClick: {
                Logic.openFile("Settings.qml")
            }
        }

    } //Item
}
